package org.wiztools.te;
import java.awt.Container;

import javax.swing.JDialog;
import javax.swing.text.EditorKit;

public interface TEMod{
	/**
	@return The complete text in the buffer.
	*/
	public String getText();
	
	/**
	@return The selected text in the buffer.
	*/
	public String getSelectedText();
	
	/**
	New text is set in the buffer.
	*/
	public void setText(String str);
	
	/**
	Insert new text in the cursor position.
	*/
	public void insert(String str);
	
	/**
	Replace selection with the new string.
	*/
	public void replaceSelection(String str);
	
	/**
	Start selection.
	*/
	public void setSelectionStart(int i);
	
	/**
	End selection.
	*/
	public void setSelectionEnd(int i);
	
	/**
	Get the selection start.
	*/
	public int getSelectionStart();
	
	/**
	Get the selection end.
	*/
	public int getSelectionEnd();
	
	/**
	Select the complete buffer.
	*/
	public void selectAll();
	
	/**
	Append to the end of the buffer.
	*/
	public void append(String str);
	
	// Caret Position
	/**
	Get the caret position.
	*/
	public int getCaretPosition();
	
	/**
	Set the caret position.
	*/
	public void setCaretPosition(int i);
	
	/**
	Returns the number of lines in the buffer.
	*/
	public int getLineCount();
	
	// Request Focus
	/**
	Requests focus of the buffer display component.
	*/
	public void requestFocus();
	
	// File Dialog Operations
	/**
	The "save file" dialog is displayed.
	*/
	public void saveFile();
	
	/**
	The "save file as" dialog is displayed.
	*/
	public void saveFileAs();
	
	/**
	The "open file" dialog is displayed.
	*/
	public void openFile();
	
	/**
	The "new file" dialog is displayed.
	*/
	public void newFile();
	
	/**
	Quit the application, after verifying the shutdown operations like whether the buffer
	is saved or not.
	*/
	public void quit();
	
	// Dialog Box
	/**
	Display a custom dialog. The ``ct'' is set in the JDialog instance (available through getJD()).
	*/
	public void dispDialog(Container ct, String title);
	
	/**
	Set the visibility of the JDialog to ``false''.
	*/
	public void closeDialog();
	
	/**
	Get the instance of the JDialog, having the TextEditor frame as the parent.
	*/
	public JDialog getJD();
        
        /**
         * Sets the syntax highlight in editor
         * @param lang
         */
        public void setEditorSyntax(EditorKit lang);
}
